﻿/*!
* File Name:        Events.js
* Created When:     2012-05-29
* Created by:       陈鹏
* Created Whys:         
*/


//马上开始
function Begin() {
    goToPage(1);
    _gaq.push(['_trackEvent','Order','Start','Beetle2012']);//TrackingCode 开始

}
//选择颜色-上一步
function ColorPre() {
//    $('#hid_colorType').val("");
//    $('#hid_colorValue').val("");
//    $('#hid_img').val("");
//    $('#hid_Viewimg').val("");

//    var anchors = document.getElementsByTagName("a");
//    for (var i = 0; i < anchors.length; i++) {
//        if (anchors[i].className.toLowerCase() == 'current') {
//            anchors[i].className = "";
//        }
//    }
    //$('#jufenghong').attr("class", "current");
    goToPage(1);
}
//选择坐垫上一步
function SeatPre() {
    //alert($("#hid_colorImgId").val());
    $("#" + $("#hid_colorImgId").val() + "").attr("class", "current");
//    $('#hid_seat').val("");

//    var anchors = document.getElementsByTagName("a");
//    for (var i = 0; i < anchors.length; i++) {
//        if (anchors[i].className.toLowerCase() == 'current') {
//            anchors[i].className = "";
//            break;
//        }
//    }
//    $('#jufenghong').attr("class", "current");
    goToPage(2);
}

//车型-下一步
function Event_Type_Next() {
    var model12 = $('#type12').val();
    var model14 = $('#type14').val();
    var colorType = $('#hid_colorType').val();
    var colorValue = $('#hid_colorValue').val();
    var hidImg = $('#hid_img').val();
    var hidViewImg = $('#hid_Viewimg').val();
    //    alert(colorType);
    //    alert(colorValue);
    //    alert(hidImg);
    //    alert(hidViewImg);
    var html = $('.bPic ul');
    html.html("");
    var capcity = "";

    if ($("#hid_colorImgId").val() == "") {
        $("#hid_colorImgId").val('zhenghei');
        // alert($("#hid_colorImgId").val());
    }

    if (model12 == 0 && model14 == 0) {
        alert('请选择车型');
    }
    else {
        if (model12 == 0) {
            $('#hid_model').val("1.4TSI");
            $('#hid_type').val(model14);
            //            alert($('#hid_model').val());
            //            alert($('#hid_type').val());
            capcity = "T14";
            if (colorType == "" && colorValue == "" && hidImg == "" && hidViewImg == "") {
                $('#hid_colorType').val("标准漆");
                $('#hid_colorValue').val("正黑");
                $('#hid_img').val("zhenghei1_h.png");
                $('#hid_Viewimg').val("zhenghei1_h_small.png");

                //设置默认图片
                if (model14 != "运动型") {
                    html.append("<li><img src=\"images/zhenghei3_c.png\" width=\"960\" height=\"455\" /></li>");
                    html.append("<li><img src=\"images/zhenghei1_c.png\" width=\"960\" height=\"455\" /></li>");
                    html.append("<li><img src=\"images/zhenghei2_c.png\" width=\"960\" height=\"455\" /></li>");
                }
                else {
                    html.append("<li><img src=\"images/zhenghei3_h.png\" width=\"960\" height=\"455\" /></li>");
                    html.append("<li><img src=\"images/zhenghei1_h.png\" width=\"960\" height=\"455\" /></li>");
                    html.append("<li><img src=\"images/zhenghei2_h.png\" width=\"960\" height=\"455\" /></li>");
                }
            }
            else {
                var img = $("#hid_imgId").val();
                html.append("<li><img src=\"images/" + img + "3_h.png\" width=\"960\" height=\"455\" /></li>");
                html.append("<li><img src=\"images/" + img + "1_h.png\" width=\"960\" height=\"455\" /></li>");
                html.append("<li><img src=\"images/" + img + "2_h.png\" width=\"960\" height=\"455\" /></li>");
            }
        }
        else {
            $('#hid_model').val("1.2TSI");
            $('#hid_type').val(model12);

            capcity = "T12";
            if (colorType == "" && colorValue == "" && hidImg == "" && hidViewImg == "") {
                $('#hid_colorType').val("标准漆");
                $('#hid_colorValue').val("正黑");
                $('#hid_img').val("zhenghei1_c.png");
                $('#hid_Viewimg').val("zhenghei1_c_small.png");

                //设置默认图片
                html.append("<li><img src=\"images/zhenghei3_c.png\" width=\"960\" height=\"455\" /></li>");
                html.append("<li><img src=\"images/zhenghei1_c.png\" width=\"960\" height=\"455\" /></li>");
                html.append("<li><img src=\"images/zhenghei2_c.png\" width=\"960\" height=\"455\" /></li>");
            }
            else {
                var img = $("#hid_imgId").val();
                html.append("<li><img src=\"images/" + img + "3_c.png\" width=\"960\" height=\"455\" /></li>");
                html.append("<li><img src=\"images/" + img + "1_c.png\" width=\"960\" height=\"455\" /></li>");
                html.append("<li><img src=\"images/" + img + "2_c.png\" width=\"960\" height=\"455\" /></li>");
            }
        }
        //显示隐藏礁石蓝
        if (($('#hid_model').val() == "1.4TSI") && ($('#hid_type').val() == "运动型")) {
            $('#jiaoshilan').show();
        }
        else {
            $('#jiaoshilan').hide();
        }

        //最后一页图片默认
        $('#resuletImg').html("");
        var img = document.createElement('img');
        img.src = 'images/' + $('#hid_img').val();
        //img.style.width = "550px";
        //img.style.height = "265px";
        document.getElementById('resuletImg').appendChild(img);
        //预览信息图片默认
        $("#infoImg_td").html("");
        var View_img = document.createElement('img');
        View_img.src = 'images/' + $('#hid_Viewimg').val();
        //    View_img.style.width = "550px";
        //    View_img.style.height = "265px";
        document.getElementById('infoImg_td').appendChild(View_img);
        $("#infoImg_td").append("<br /><span style=\"padding-left: 50px;\">*最终车型配置，以客户在经销商处签订合同为准。</span>");
        //默认坐垫
        var imgSeat = arr[capcity][$('#hid_colorType').val()][$('#hid_colorValue').val()][$('#hid_type').val()].img;
        var nameSeat = arr[capcity][$('#hid_colorType').val()][$('#hid_colorValue').val()][$('#hid_type').val()].name;
        //alert(imgSeat);
        var seatHtml = $('.selectNs');
        seatHtml.html('');
        $('#seatPic').html('');
        var seatBGimg = document.createElement('img');
        seatBGimg.src = 'images/' + imgSeat[0] + "bg.jpg";
        document.getElementById('seatPic').appendChild(seatBGimg);
        $('#hid_seat').val(nameSeat[0]);
        for (var i = 0; i < imgSeat.length; i++) {

            if (imgSeat[i] != "") {
                if (i == 0) {
                    seatHtml.append("<dl><dt>" + nameSeat[i] + "</dt><dd><a class=\"current\" id=\"seatid" + (i + 1) + "\" href=\"javascript:GetSeat('" + nameSeat[i] + "','" + imgSeat[i] + "','" + (i + 1) + "');\" ><img src='images/" + imgSeat[i] + ".png'  /></a></dd></dl>");
                } else {
                    seatHtml.append("<dl><dt>" + nameSeat[i] + "</dt><dd><a  id=\"seatid" + (i + 1) + "\" href=\"javascript:GetSeat('" + nameSeat[i] + "','" + imgSeat[i] + "','" + (i + 1) + "');\" ><img src='images/" + imgSeat[i] + ".png'  /></a></dd></dl>");
                }
            }
        }

        goToPage(2);
        flag = true;
    }
    return flag;
    _gaq.push(['_trackEvent', 'Order', 'Type', 'Beetle2012']); //TrackingCode 选车型
}
 //颜色-下一步
function Next_Color() {
    _gaq.push(['_trackEvent', 'Order', 'Color', 'Beetle2012']); //TrackingCode 选颜色
    //alert($("#hid_colorImgId").val());
    var flag = false;
   //alert($('#hid_colorValue').val());
    
    if ($('#hid_colorValue').val() == "") {
        flag = false;
        alert("请选择颜色");
    }
    else {
        flag = true;
        goToPage(3)
    }
    //return flag
}
//坐垫-下一步
function seatDivNext() {
    _gaq.push(['_trackEvent', 'Order', 'Interior', 'Beetle2012']); //TrackingCode 选内饰座椅颜色
   //alert($('#hid_seat').val());
    var flag = false;
    if ($('#hid_seat').val() == "") {
        flag = false;
        alert("请选择坐垫");
    }
    else {
        flag = true;
        goToPage(4);
    }
    return flag
}
//选择坐垫
function GetSeat(flag, img, id) {

    $('#hid_seat').val(flag);
    //$(".selectNs a").attr("class", "");

    var anchors = $(".selectNs a");
    for (var i = 0; i < anchors.length; i++) {
        if (anchors[i].className.toLowerCase() == 'current') {
            //alert(anchors[i].className);
            anchors[i].className = "";
            //alert(anchors[i].className);
            if ((window.navigator.appName.toUpperCase().indexOf("MICROSOFT") >= 0) && (document.execCommand)) {
            //IE浏览器
                            anchors[i].fireEvent("onmouseover", true);
                            anchors[i].fireEvent("onmouseenter", true);
                            anchors[i].fireEvent("onmouseleave", true);
            }
        }
    }
    $("#seatid1").attr("class", "");
    $("#seatid" + id + "").attr("class", "current");


    var html = $('#seatPic');
    html.html("");
    html.append("<img width=\"960\" height=\"455\"  src=\"images/" + img + "bg.jpg\" />");
    // alert($('#hid_seat').val());
    
}
//选择颜色
function SetColor(type, value, flag) {
//    alert(type);
//    alert(value);
    //    alert(flag);
//清除样式
    $('.selectColor a').each(function () {
        if (($(this).attr("class") == "current")) {
            $(this).removeAttr("class");
        }
    });

    //$('.selectColor a').removeAttr("class");
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        if (anchors[i].className.toLowerCase() == 'current') {
            anchors[i].className = "";
//            anchors[i].fireEvent("onmouseover", true);
//            anchors[i].fireEvent("onmouseenter", true);
//            anchors[i].fireEvent("onmouseleave", true);
        }
    }
    $("#hid_imgId").val("");
    $("#hid_imgId").val(flag);
    $("#hid_colorImgId").val(flag);
    //alert($("#hid_colorImgId").val());
    $("#" + flag + "").attr("class", "current");
    $('#hid_colorType').val(type);
    $('#hid_colorValue').val(value);
    var html = $('.bPic ul');
    html.html("");
   // alert($('#hid_model').val());
   // alert($('#hid_type').val());
    if ($('#hid_model').val() == "1.4TSI" && $('#hid_type').val() == "运动型") {
        html.append("<li><img src=\"images/" + flag + "3_h.png\" width=\"960\" height=\"455\" /></li>");
        html.append("<li><img src=\"images/" + flag + "1_h.png\" width=\"960\" height=\"455\" /></li>");
        html.append("<li><img src=\"images/" + flag + "2_h.png\" width=\"960\" height=\"455\" /></li>");
        $('#hid_img').val(flag + "1_h.png");
        $('#hid_Viewimg').val(flag + "1_h_small.png");
    }
    else {
        html.append("<li><img src=\"images/" + flag + "3_c.png\" width=\"960\" height=\"455\" /></li>");
        html.append("<li><img src=\"images/" + flag + "1_c.png\" width=\"960\" height=\"455\" /></li>");
        html.append("<li><img src=\"images/" + flag + "2_c.png\" width=\"960\" height=\"455\" /></li>");
        $('#hid_img').val(flag + "1_c.png");
        $('#hid_Viewimg').val(flag + "1_c_small.png");
    }

    var hidImg = $('#hid_img').val();
    //alert(hidImg);
    var viewImg = $('#hid_Viewimg').val();
    //最后一页图片
    $('#resuletImg').html("");
    var img = document.createElement('img');
    img.src = 'images/' + hidImg;
    //img.style.width = "550px";
    //img.style.height = "265px";
    document.getElementById('resuletImg').appendChild(img);

    //预览信息图片
    $("#infoImg_td").html("");
    var View_img = document.createElement('img');
    View_img.src = 'images/' + viewImg;
//    View_img.style.width = "550px";
//    View_img.style.height = "265px";
    document.getElementById('infoImg_td').appendChild(View_img);

    $("#infoImg_td").append("<br /><span style=\"padding-left: 50px;\">*最终车型配置，以客户在经销商处签订合同为准。</span>");
    //alert("2:"+$("#infoImg_td").html());
    //alert($('#hid_model').val());
    var capcity = $('#hid_model').val() == "1.2TSI" ? "T12" : "T14";
//    alert("111:" + $('#hid_type').val());
//    alert("c:" + capcity);
//    alert('type' + type);
//    alert('value' + value);
//    alert('hid' + $('#hid_type').val());
   var imgSeat = arr[capcity][type][value][$('#hid_type').val()].img;
   var nameSeat = arr[capcity][type][value][$('#hid_type').val()].name;
//    alert(capcity);
//    alert(type);
//    alert(value);
//    alert($('#hid_type').val());
   // alert("a：" + imgSeat);
    //alert("b：" + nameSeat);

    var html = $('.selectNs');
    html.html('');
    $('#seatPic').html('');

    var seatBGimg = document.createElement('img');
    seatBGimg.src = 'images/' + imgSeat[0] + "bg.jpg";
    document.getElementById('seatPic').appendChild(seatBGimg);


    for (var i = 0; i < imgSeat.length; i++) {
        if (imgSeat[i] != "") {
            if (i == 0) {
                html.append("<dl><dt>" + nameSeat[i] + "</dt><dd><a class=\"current\" id=\"seatid" + (i + 1) + "\" href=\"javascript:GetSeat('" + nameSeat[i] + "','" + imgSeat[i] + "','" + (i + 1) + "');\" ><img src='images/" + imgSeat[i] + ".png'  /></a></dd></dl>");
                $('#hid_seat').val("");
                $('#hid_seat').val(nameSeat[0]);
            }
            else {
                html.append("<dl><dt>" + nameSeat[i] + "</dt><dd><a id=\"seatid" + (i + 1) + "\" href=\"javascript:GetSeat('" + nameSeat[i] + "','" + imgSeat[i] + "','" + (i + 1) + "');\" ><img src='images/" + imgSeat[i] + ".png'  /></a></dd></dl>");
            }
            
        }
    }
//    alert('排量：' + $('#hid_model').val());
//    alert('车型：' + $('#hid_type').val());
//    alert('颜色类别：' + $('#hid_colorType').val());
//    alert('颜色值：' + $('#hid_colorValue').val());
//        alert('坐垫图片：' + imgSeat);
//     alert('坐垫名字：' + $('#hid_seat').val());
    
}


//预览下一步
function View_Reg() {
    _gaq.push(['_trackEvent', 'Order', 'Preview', 'Beetle2012']); //TrackingCode 预览
    var provinceValue = $('#pro').find("option:selected").val();
    var cityValue = $('#city').find("option:selected").val();
    var dealerValue = $('#dealer').find("option:selected").val();
//    alert(provinceValue);
//    alert(cityValue);
//    alert(dealerValue);


    var error = "";
    //姓名
    if ($('#name').val() =="") {
        error += "请输入姓名！\n";
    }
    else {
        var regExp = new RegExp("^[A-Za-z\\u4e00-\\u9fa5]+$").test($('#name').val());
        if (regExp == false) {
            //if (!/\d{11}/.test(mobile)) {
            error += "请输入真实姓名！\n";
        }
        else {
            $('#hid_name').val($('#name').val());
            //        Car.Name = $('#name').val();
        }
    }
    //称谓
    var sex = $("input[name='sex']:checked").val();
    if (typeof sex == 'undefined') {
        error += "请选择称谓！\n";
    }
    else {
        $('#hid_sex').val(sex);
//        Car.Sex = sex;
    }
    //手机号
    var mobile = $('#mobile').val();
    if (mobile == "") {
        error += "请输入手机号！\n";
    }
    else {
        var regExp = new RegExp("^0?(13|15|18)[0-9]{9}$").test(mobile);
        if (regExp == false) {
            //if (!/\d{11}/.test(mobile)) {
            error += "手机号应为11位有效数字！\n";
        }
        else {
            $('#hid_mobile').val(mobile);
            //            Car.Mobile = $('#mobile').val();
        }
    }
    //邮箱
    var email = $('#email').val();
    if (email.length>0) {
        var reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
        if (!reg.test(email)) {
            error += "邮箱地址格式错误！\n";
        }
        else {
            var flag = 0;
            var flag = isExist(email);
            //alert(flag);
            if (flag > 0) {
                error += "此邮箱地址已成功预定甲壳虫，请保持手机畅通，我们客服人员会跟您确认详细信息！\n";
            }
            else {
                $('#hid_email').val(email);
//                Car.Email = email; 
            }
        }
    }
    else {
        error += "请输入邮箱！\n";
    }
    //省
    
    if ($('#pro').val() == "0") {
        error += "请选择省份！\n";
    }
    else {
        var text = $('#pro').find("option:selected").text();
        $('#hid_pro').val(text);
//        Car.Province = $('#pro').find("option:selected").text();
    }
    //市
    if ($('#city').val() == "0") {
        error += "请选择城市！\n";
    }
    else {
        var text = $('#city').find("option:selected").text();
        $('#hid_city').val(text);
//        Car.City = $('#city').find("option:selected").text();
    }
    //经销商
    if ($('#dealer').val() == "0") {
        error += "请选择经销商！\n";
    }
    else {
        var text = $('#dealer').find("option:selected").text();
        $('#hid_dealer').val(text);
        //Car.Dealer = $('#dealer').find("option:selected").text();
    }
    //预算
    if ($('#budget1').val() == "" || $('#budget2').val() == "") {
        error += '请输入您的购车预算！\n';
    }
    else {
       // alert($('#budget1').val());
       // alert($('#budget2').val());
        var reg1 = new RegExp("^[0-9]\\d*$").test($('#budget1').val());
        var reg2 = new RegExp("^[0-9]\\d*$").test($('#budget2').val());
       // alert(reg1);
       // alert(reg2);
        if (reg1 == false || reg2 == false) {
            error += '请输入数字！\n';
        }
        else {
            if ($('#budget2').val() < $('#budget1').val()) {
                error += '请输入正确的数字！\n';
            }
            else {
                var text = $('#budget1').val() + "万-" + $('#budget2').val() + "万";
                $('#hid_budget').val(text);
                //                Car.Budget = $('#budget1').val() + "万-" + $('#budget2').val() + "万";
            }

        }
    }
    // 提车时间
    var mention = $('#year').val() + $('#month').val() + "月";
    if ($('#year').val() != "0" && $('#month').val() != "0")
        $('#hid_mention').val(mention);
    //        Car.Mention = $('#year').val() + $('#month').val() + "月";
    else
        error += "请选择购车时间！\n";
    if (error != '') {
        alert(error);
        return false;
    }
    else {
//        alert("排量：" + $('#hid_model').val());
//        alert("车型：" + $('#hid_type').val());
//        alert("颜色类型：" + $('#hid_colorType').val());
//        alert("颜色：" + $('#hid_colorValue').val());
//        alert("座椅：" + $('#hid_seat').val());
//        alert("姓名：" + $('#hid_name').val());
//        alert("称谓：" + $('#hid_sex').val());
//        alert("手机：" + $('#hid_mobile').val());
//        alert("邮箱：" + $('#hid_email').val());
//        alert("省：" + $('#hid_pro').val());
//        alert("城市：" + $('#hid_city').val());
//        alert("经销商：" + $('#hid_dealer').val());
//        alert("预算：" + $('#hid_budget').val());
//        alert("时间：" + $('#hid_mention').val());
//        alert("来源：" + $('#hid_source').val());
        goToPage(5);
        GetInfo()
        return true;
    }
    //_gaq.push(['_trackEvent','Order','Information','Beetle2012']); //TrackingCode 填写个人信息
    
}
//邮箱验证
function isExist(email) { //唯一验证
    try {
        var flag;
        $.ajax({
            type: "GET",
            url: "action_preorder.aspx",
            dataType: "text",
            async: false,
            data: "op=isExist&email=" + encodeURIComponent(email) + "&random=" + new Date().toLocaleString(),
            beforeSend: function (xmlHttpRequest) {
            },
            success: function (data, textStatus) {
              //  alert("email:" + data);
                flag = data;
            },
            complete: function (xmlHttpRequest, textStatus) {

            },
            error: function () {
                flag = 1;
            }
        });
//        if (flag>0) {
//            goToPage(4);
//        }
    }
    catch (e) {
        alert("exception: " + e.Message);
    }
    return flag;
}
function submitlater() {
    goToPage(6);
    window.setTimeout("Submit()", 3000);
}


//提交
function Submit() {
    //alert($('#hid_source').val());
    _gaq.push(['_trackEvent', 'Order', 'Submit', 'Beetle2012']); //TrackingCode 提交
    var name = $('#hid_name').val();
    var sex = $('#hid_sex').val();
    var mobile = $('#hid_mobile').val();
    var email = $('#hid_email').val();
    var province = $('#hid_pro').val();
    var city = $('#hid_city').val();
    var dealer = $('#hid_dealer').val();
    var budget = $('#hid_budget').val();
    var mention = $('#hid_mention').val();
    var capcity = $('#hid_model').val();
    var carModel = $('#hid_type').val();
    var carColor = $('#hid_colorType').val() + "_" + $('#hid_colorValue').val();
    var carSeat = $('#hid_seat').val();
    var img = $('#hid_img').val();
    var provinceValue = $('#pro').find("option:selected").val();
    var cityValue = $('#city').find("option:selected").val();
    var dealerValue = $('#dealer').find("option:selected").val();
    var source = $('#hid_source').val();
    var channel = $('#hid_medium').val();
    try {
        var flag;
        $.ajax({
            type: "GET",
            url: "action_preorder.aspx",
            dataType: "text",
            async: false,
            data: "op=reg&img=" + encodeURIComponent(img) + "&provinceValue=" + encodeURIComponent(provinceValue) + "&cityValue=" + encodeURIComponent(cityValue) + "&dealerValue=" + encodeURIComponent(dealerValue) + "&name=" + encodeURIComponent(name) + "&sex=" + encodeURIComponent(sex) + "&mobile=" + encodeURIComponent(mobile) + "&email=" + encodeURIComponent(email) + "&province=" + encodeURIComponent(province) + "&city=" + encodeURIComponent(city) + "&dealer=" + encodeURIComponent(dealer) + "&budget=" + encodeURIComponent(budget) + "&mention=" + encodeURIComponent(mention) + "&capcity=" + encodeURIComponent(capcity) + "&carModel=" + encodeURIComponent(carModel) + "&carColor=" + encodeURIComponent(carColor) + "&carSeat=" + encodeURIComponent(carSeat) + "&source=" + encodeURIComponent(source) + "&channel=" + encodeURIComponent(channel) + "&random=" + new Date().toLocaleString(),
            beforeSend: function (xmlHttpRequest) {
                
            },
            success: function (data, textStatus) {
              //  alert("data:" + data);
//                if (data > 0) {
//                    flag = true;
//                }
            },
            complete: function (xmlHttpRequest, textStatus) {

            },
            error: function () {
                flag = false;
            }
        });
//        if (flag) {
//            _gaq.push(['_trackEvent', 'Order', 'Succeed', 'Beetle2012']); //TrackingCode 提交成功
//            
//        }
    }
    catch (e) {
        alert("exception: " + e.Message);
    }
    
//    _gaq.push(['_trackEvent', 'Order', 'Succeed', 'Beetle2012']); //TrackingCode 提交成功

}
//加载预览信息
function GetInfo() {
    
    
//    您的姓名：xxx先生<br />
//    手机号码：139xxxxxxx<br />
//    电子邮箱：sunzhen@yahoo.com.cn<br />
//    省份城市：北京xxxx经销商<br />
//    购车预算：20万－40万<br />
//    购车时间：2012年3月<br />
//    <br />
//    车辆信息：1.2TSI COMFORT LINE<br />
//    <span style="padding-left: 60px;">白色</span><br />
    //    <span style="padding-left: 60px;">真皮座椅／米色</span>
    

    var html = $('#info');
    html.html("");
    html.append("您的姓名：" + $('#hid_name').val() + $('#hid_sex').val() + "<br />");
    html.append("手机号码：" + $('#hid_mobile').val() + "<br />");
    html.append("电子邮箱：" + $('#hid_email').val() + "<br />");
    html.append("省份城市：" + $('#hid_dealer').val() + "<br />");
    html.append("购车预算：" + $('#hid_budget').val() + "<br />");
    html.append("购车时间：" + $('#hid_mention').val() + "<br />");
    html.append("<br />");
    html.append("车辆信息：" + $('#hid_model').val() + $('#hid_type').val() + " <br />");
    html.append("<span style=\"padding-left: 60px;\">" + $('#hid_colorType').val() + "-" + $('#hid_colorValue').val() + "</span><br />");
    html.append("<span style=\"padding-left: 60px;\">" + $('#hid_seat').val() + "</span>");
    
}

function GetProvince() { //获取省份
    try {
        var flag = "";
        $.ajax({
            type: "GET",
            url: "GetDealeraspx.aspx",
            dataType: "text",
            async: false,
            data: "op=GetProvince&random=" + new Date().toLocaleString(),
            beforeSend: function (xmlHttpRequest) {
            },
            success: function (data, textStatus) {
             //   alert("省:" + data);
                flag = data;
            },
            complete: function (xmlHttpRequest, textStatus) {

            },
            error: function () {
            }
        });
    }
    catch (e) {
        alert("exception: " + e.Message);
    }
    return flag;
}
function GetCity(pid) { //获取城市
    try {
        var flag = "";
        $.ajax({
            type: "GET",
            url: "GetDealeraspx.aspx",
            dataType: "text",
            async: false,
            data: "pid="+pid+"&random=" + new Date().toLocaleString(),
            beforeSend: function (xmlHttpRequest) {
            },
            success: function (data, textStatus) {
             //   alert("市:" + data);
                flag = data;
            },
            complete: function (xmlHttpRequest, textStatus) {

            },
            error: function () {
            }
        });
    }
    catch (e) {
        alert("exception: " + e.Message);
    }
    return flag;
}
function GetDealer(cid) { //获取经销商
    try {
        var flag = "";
        $.ajax({
            type: "GET",
            url: "GetDealeraspx.aspx",
            dataType: "text",
            async: false,
            data: "cid=" + cid + "&random=" + new Date().toLocaleString(),
            beforeSend: function (xmlHttpRequest) {
            },
            success: function (data, textStatus) {
                //     alert("获取经销商:" + data);
                flag = data;
            },
            complete: function (xmlHttpRequest, textStatus) {

            },
            error: function () {
            }
        });
    }
    catch (e) {
        alert("exception: " + e.Message);
    }
    return flag;
}

function Track1() {
    _gaq.push(['_trackEvent', 'Order', 'BeetleSite', 'Beetle2012']); //TrackingCode新甲壳虫官网
    window.open("http://rns.vwbeetle.cn/");
}
function Track2() {
    _gaq.push(['_trackEvent', 'Order', 'LegendJourney', 'Beetle2012']); //TrackingCode甲壳虫传奇之旅
    window.open("http://hof.vwbeetle.cn/");
}